#!/bin/sh
set -e

### BEGIN INIT INFO
# Provides:           azure-iot-solution
# Required-Start:     $syslog $remote_fs $docker
# Required-Stop:      $syslog $remote_fs $docker
# Should-Start:       docker
# Should-Stop:
# Default-Start:      2 3 4 5
# Default-Stop:       0 1 6
# Short-Description:  Azure IoT Solution
# Description:
#  Visit www.AzureIoTSolutions.com for more information.
### END INIT INFO

# Get lsb functions
. /lib/lsb/init-functions

case "$1" in
    start)
        /app/start.sh
        ;;
    stop)
        /app/stop.sh
        ;;
    restart)
        /app/start.sh
        ;;
    status)
        /app/status.sh
        ;;
    *)
        echo "Usage: service azure-iot-solution {start|stop|restart|status}"
        exit 1
        ;;
esac
